let that,
  api = new (require('../../utils/api.js')),
  util = new (require('../../utils/util.js'));
Page({

  /**
   * 页面的初始数据
   */
  data: {
    start: 0,
    pagesize: 10,
    data: {},
    myid: '',
    id: '',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    that = this;
    var app = getApp();
    console.log(app.logininfo);
    that.setData({
      myid: app.logininfo.userid,
      id: options.id
    })
    that.getdata(options.id);
  },

  getdata(id) {
    let { start, pagesize } = that.data;
    api.myfof(
      { start, pagesize, isfans: 0, id }, res => {
        that.setData({
          data: res.data
        })
      })
  },
  befans(e) {
    console.log(e,'eee')
    let { idolid } = e.currentTarget.dataset,
      { id } = that.data;
    api.follow({ idolid }, res => {
      if (res.issuccess = 1) {
        that.getdata(id)
      }
    })

  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})